﻿using System.Collections.Generic;
using System.Linq;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoL.Core.StatusEffects;
using LBoL.EntityLib.Cards.Character.Cirno;
using LBoLEntitySideloader.Attributes;
using ProbeMod.Cards.Template;
using ProbeMod.StatusEffects;

namespace ProbeMod.Cards
{
    public sealed class ProbeSeekProphecyDef : ProbeCardTemplate
    {
        public override CardConfig MakeConfig()
        {
            CardConfig config = GetCardDefaultConfig();

            config.Rarity = Rarity.Uncommon;
            config.Type = CardType.Ability;
            config.TargetType = TargetType.Nobody;

            config.Colors = new List<ManaColor>() { ManaColor.Blue };
            config.Cost = new ManaGroup() { Blue = 1 };
            config.UpgradedCost = new ManaGroup() { Blue = 1 };

            config.Scry = 3;
            config.UpgradedScry = 5;

            config.Value1 = 3;

            config.Index = CardIndexGenerator.GetUniqueIndex(config);
            return config;
        }
    }

    /// <summary>
    /// 追寻预言
    /// 占卜3 / 5
    /// 获得萨尔那加神器（状态）
    /// 若拥有全部神器，回合结束获得3火3灵
    /// </summary>
    [EntityLogic(typeof(ProbeSeekProphecyDef))]
    public sealed class ProbeSeekProphecy : ProbeCard
    {
        protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
        {
            yield return new ScryAction(Scry);
            yield return BuffAction<ProbeXelnagaArtifactSe>(level: 1);
        }
    }
}
